package cn.wolfcode.wolf2w.business.service;

import cn.wolfcode.wolf2w.business.api.domain.DestinationES;
import cn.wolfcode.wolf2w.business.api.domain.NoteES;
import cn.wolfcode.wolf2w.business.api.domain.StrategyES;
import cn.wolfcode.wolf2w.business.api.domain.UserES;
import cn.wolfcode.wolf2w.business.query.SearchQuery;

import org.apache.poi.ss.formula.functions.T;
import org.springframework.data.domain.Page;

import java.lang.reflect.InvocationTargetException;

public interface ISearchService {

    void saveStrategy(StrategyES strategyES);

    /*
    * 高亮查询通用接口，可以查询攻略，游记，问答，找人
    * T表示查询数据的MySQL的实体类类型，如攻略Strategy
    * clazz--MySQL数据库的class类型
    * esClazz--ES数据库的class类型
    * qo--查询参数
    * fields--可变长参数，表示查询哪些列（列名）
    * */
    <T> Page<T> searchWithHighLight(Class<T> clazz,Class<?> esClazz, SearchQuery qo, String... fields) throws InvocationTargetException, IllegalAccessException;

    void saveUserES(UserES userES);

    void saveNoteEs(NoteES noteES);

    void saveDestinationEs(DestinationES destinationES);
}
